#include "FITKPlotDataManager.h"
#include "FITKXYPlotWindow.h"
#include "FITKXYCoordinate.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
namespace Plot 
{
    Plot::FITKPlotWindowsInterface* FITKPlotDataManager::setPlotData(int type, QString xName, QString yName)
    {
        Plot::FITKPlotWindowsInterface* PlotWindows = Plot::FITKPlotWindowsInterface::getInstance();

        QString type = plot->getWindowType();
        if (type == "Normal") {
            FITKXYPlotWindow * XYPlot = dynamic_cast<FITKXYPlotWindow*>(plot);
            FITKXYCoordinate* plotData = FITKAPP->getGlobalData()->getPlotData<FITKXYCoordinate>(enum Plot);
            QList<struct> plotDataList = plotData->geXYtPlotDataList();
            for (int i = 0; i < plotDataList->size();i++) {
                XYPlot->add_curve(plotDataList[i]->QVector<double> x, plotDataList[i]->QVector<double> y, plotDataList[i]->QString name, plotDataList[i]->QColor.......);
            }
            return true;
        }
        else if (type == "Log") {

        }
        else if (type == "BarChart") {

        }
        return false;
    }

}
